package com.xnyzc.lhy.mis.controller.cmsapi.message;


import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.mis.entity.param.message.OaSysMessageInappParam;
import com.xnyzc.lhy.mis.entity.param.message.PageSizeParam;
import com.xnyzc.lhy.mis.service.message.IOaSysMessageInappService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 后台管理 应用内消息表 前端控制器
 * </p>
 *
 * @author wangshuo
 * @since 2019-10-20
 */
@RestController
@Api(value = "后台管理—运营中心—应用内消息",tags={"应用内消息接口"})
@RequestMapping("/cmsapi/message")
public class OaSysMessageInappController {

    @Autowired
    IOaSysMessageInappService iOaSysMessageInappService;

    /**
     * 添加司机应用内消息
     * oa_sys_message_inapp
     * oa_sys_message_driver
     * */

    @ApiOperation(value = "运营中心添加应用内消息", notes = "运营中心添加应用内消息")
    @PostMapping(value = "/insertSysMessageInapp")
    public Rv insertSysMessageInapp(@RequestBody OaSysMessageInappParam oaSysMessageInappParam){
        return iOaSysMessageInappService.insertSysMessageInapp(oaSysMessageInappParam);
    }
    /**
     * 查询司机应用内消息
     * */

    @ApiOperation(value = "查询应用内消息", notes = "查询应用内消息")
    @PostMapping(value = "/querySysMessageInappList")
    public Rv querySysMessageInappList(@RequestBody PageSizeParam pageSizeParam){
        return iOaSysMessageInappService.querySysMessageInappList(pageSizeParam.getCurrent(),pageSizeParam.getPageSize());
    }
    /**
     * 消息类型查询
     * */
    @ApiOperation(value = "消息类型查询", notes = "消息类型查询")
        @PostMapping(value = "/querySysMessageType")
    public Rv querySysMessageType(){
        return iOaSysMessageInappService.querySysMessageType();
    }
}
